home *** CD-ROM | disk | FTP | other *** search
- Mod by Gilgamesh #1 @4104 NukeNet
- Donate.mod adds donations list similar to the bbs list...
-
- Add this case to void mainmenu() in BBS.C
-
- case '$':
- donate();
- break;
-
- Add this void to MISCCMND.C
-
- void donate()
- {
- int i,i1,i2,f,done,ok;
- char s[150],s1[150],s2[150],ch,ch1,*ss;
- char amount[5];
- long l,l1;
-
- done=0;
- printfile("DONATE.MSG");
- do {
- nl();
- prt(2,"Donations [I]:nfo, [L]:ist, [D]:onate, [Q]:uit > ");
- ch=onek("QILD");
- switch(ch) {
- case 'Q':
- done=1;
- break;
- case 'I':
- printfile("DINFO.MSG");
- break;
- case 'L':
- pl("╔══════════════════════════════════════════╗");
- pl("║ Name Amount ║");
- pl("╚══════════════════════════════════════════╝");
- printfile("DONATES.MSG");
- break;
- case 'D':
- if ((actsl<=10)) {
- nl();
- nl();
- pl("You must be a validated user to add to the Donations list.");
- nl();
- break;
- }
- nl();
- npr("Hello %s ",thisuser.name);
- nl();
- pl("Enter the amount you wish to donate");
- pl("In the form ##.##");
- outstr(":");
- mpl(5);
- input(amount,5);
- sprintf(s,"%-34s $%5s\r\n",thisuser.name, amount);
- nl();
- nl();
- pl(s);
- nl();
- prt(5,"Is this correct? ");
- if (yn()) {
- sprintf(s1,"%sDONATES.MSG",syscfg.gfilesdir);
- f=open(s1,O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
- if (filelength(f)) {
- lseek(f,-1L,SEEK_END);
- read(f,((void *)&ch1),1);
- if (ch1==26)
- lseek(f,-1L,SEEK_END);
- }
- write(f,(void *)s,strlen(s));
- close(f);
- nl();
- pl("Added to Donations list.");
- }
- break;
- }
- } while ((!done) && (!hangup));
- }
-